package arkham.data;

import java.util.List;

import arkham.data.Globals.UsablePhase;

public interface EffectSource extends NamedEntity
{

    /**
     * Gets the number of times this effect source can be used for LIMITED usage
     * @return the number of times usable
     */
    public int getLimit();

    /**
     * Sets the number of times this effect source can be used for LIMITED usage
     * @param limit the limit to set
     */
    public void setLimit(int limit);

	/**
	 * Gets the list of mod effects
	 * @return the list of mod effects
	 */
	public List<ModEffect> getModEffects();

	/**
	 * Searches for all mod effects of a certain type
	 * @param type the type to search for
	 * @return the list of mod effects of that type
	 */
	public List<ModEffect> searchModEffects(String type);

	/**
	 * Searches for all mod effects of a certain type and stores it to a list.
	 * @param list the list to store in
	 * @param type the type to search for
	 */
	public void searchModEffects(List<ModEffect> list, String type);

	/**
	 * Searches for all mod effects of a certain type and details
	 * @param type the type to search for
	 * @param details the details to search for
	 * @return the list of mod effects of that type and details
	 */
	public List<ModEffect> searchModEffects(String type, String details);

	/**
	 * Searches for all mod effects of a certain type and details and stores it to a list
	 * @param list the list to store in
	 * @param type the type to search for
	 * @param details the details to search for
	 */
	public void searchModEffects(List<ModEffect> list, String type, String details);

	/**
	 * Searches for all mod effects of a certain type that are always on
	 * @param type the type to search for
	 * @return the list of mod effects
	 */
	public List<ModEffect> searchAlwaysModEffects(String type);

	/**
	 * Searches for all mod effects of a certain type and details that are
	 * always on
	 * @param type the type to search for
	 * @param details the details to search
	 * @return the list of mod effects
	 */
	public List<ModEffect> searchAlwaysModEffects(String type, String details);

	/**
     * Gets the list of usable effects
     * @return the list of usable effects
     */
    public List<UsableEffect> getUsableEffects();

	/**
	 * Searches for all usable effects that can be used at a certain phase.
	 * @param phase the phase to search
	 * @return a list of usable effects that are usable at that phase.
	 */
	public List<UsableEffect> searchUsableEffects(UsablePhase phase);

	/**
     * Searches for all usable effects that can be used at a certain phase and stores it
     * in a list.
     * @param list the list to store in
     * @param phase the phase to search
     */
    public void searchUsableEffects(List<UsableEffect> list, UsablePhase phase);

    /**
     * Searches for all usable effects that can be used at a certain phase only and
     * have usage type "ALWAYS"
     * @param phase the phase to search
     * @return a list of usable effects that are automatically usable at a certain
     * phase only
     */
    public List<UsableEffect> searchAutoUsableEffects(UsablePhase phase);

    /**
     * Searches for all usable effects that can be used at a certain phase only and
     * have usage type "ALWAYS", then stores it in a list.
     * @param list the list to store in
     * @param phase the phase to search
     */
    public void searchAutoUsableEffects(List<UsableEffect> list, UsablePhase phase);

	/**
	 * Sets if this modifier source is exhausted for the turn
	 * @param exhausted set to true to exhaust this source, false to refresh
	 */
	public void setExhausted(boolean exhausted);

	/**
	 * Checks if a once a turn modifier has been used this turn
	 * @return true if this modifier source is exhausted
	 */
	public boolean isExhausted();

	/**
	 * Sets the number of counters on this modifier source
	 * @param numCounters the numCounters to set
	 */
	public void setNumCounters(int numCounters);

	/**
	 * Gets the number of counters on this modifier source
	 * @return the numCounters
	 */
	public int getNumCounters();

	/**
	 * Gets the identifier of this effect source.<br>
	 * Investigator cards are of the format #id<br>
	 * Personal effects are of the format %name<br>
	 * Investigator powers are just represented by their names
	 * @return the identifier
	 */
	public String getIdentifier();
}
